home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / devices / lpdev.zoo / centr.s < prev    next >
Encoding:
Text File  |  1993-07-27  |  1.0 KB  |  49 lines

  1. |
  2. | centr.s: Centronics interrupt routine. It is raised every time
  3. | the printer is ready to write one more character
  4. |
  5. | Also a few low-level functions
  6.  
  7. .globl _new_centr_vector, _print_byte
  8.  
  9. _new_centr_vector:
  10.     moveml    d0-d1/a0-a1, sp@-
  11.     jsr    _print_head        | prints the pending byte(s)
  12.     jsr    _wake_up        | has someone selected the printer?
  13.     moveml    sp@+, d0-d1/a0-a1
  14.     bclr    #0, 0xFFFFFA11
  15.     rte
  16.     
  17. _print_byte:
  18.     movew    sp@(4), d0        | character to print
  19.     movew    sr, sp@-
  20.     oriw    #0x700, sr        | disable all interrupts
  21.     movel    #0xFFFF8800, a0
  22.     moveb    #15, a0@        | select port B
  23.     moveb    d0, a0@(2)        | and write the character
  24.     moveb    #14, a0@        | select port A
  25.     moveb    a0@, d0            | read it
  26.     bclr    #5, d0
  27.     moveb    d0, a0@(2)        | strobe low
  28.     nop
  29.     nop
  30.     bset    #5, d0
  31.     moveb    d0, a0@(2)        | strobe high
  32.     movew    sp@+, sr
  33.     rts
  34.  
  35. | Utility functions to modify the interrupt mask. They'll be used
  36. | only if the NO_INLINE macro is defined.
  37.  
  38. .globl _spl7, _spl
  39.  
  40. _spl7:
  41.     movew    sr, d0
  42.     oriw    #0x700, sr
  43.     rts
  44.  
  45. _spl:
  46.     movew    sp@(4), sr
  47.     rts
  48.  
  49.